'use strict';
const encryptPassword = require('encrypt-password');
const db = uniCloud.database()
exports.main = async (event, context) => {
	let { email,password } = event;
  let modifiPassRes = await db.collection('users').where({
	  email
  }).update({
	  password:encryptPassword(password)
  })
 
 if(modifiPassRes.affectedDocs !== 0){
	 return{
		 status:0,
		 msg:"修改成功"
	 }
 }
 
  return {
	  status:-1,
	  msg:"稍后重试"
  }
};
